package week5;

import java.util.ArrayList;
import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		 int n = sc.nextInt();
		 String m;
		Object[] object=new Object[n]; 
		 for (int i = 0; i < n; i++) {
			  String str1 = sc.next();
			if (str1.equals("c")) {
				object [i]=new Computer();
			}
			else if(str1.equals("d")){
				object [i]=new Double(sc.nextDouble());
			}
			else if(str1.equals("i")){
				object[i]=new Integer(sc.nextInt());
			}
			else if(str1.equals("s")){
				m=sc.next();
				object[i]=m;
				
			}
			else
				object[i]=null;
		 }
		 for (int i =object.length-1 ; i>=0; i--){
			 if(object[i]!=null){
				 System.out.println(object[i]);
			 }
		 }
	}

}